﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SearchControl.ascx.cs"
  Inherits="NguyenHoa.Web.Controls.SearchControl" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %>
<asp:Panel ID="pn1" runat="server" DefaultButton="btnSearch" CssClass="search_box"
  Style="margin-bottom: 10px;">
  <asp:ImageButton ID="btnSearch" CssClass="button_search" runat="server" ImageUrl="../images/search_btn.gif"
    OnClick="btnSearch_Click" OnClientClick="return onSearch()" />
  <span>
    <input name="editbox_search" class="editbox_search" id="txtSearchedKey" maxlength="80"
      value="<%$Resources: Strings, Search %>" title="<%$Resources: Strings, Search %>"
      type="text" runat="server" onfocus="if(jQuery(this).val() == jQuery(this).attr('title')){jQuery(this).val('');}"
      onblur="if(jQuery(this).val() == ''){jQuery(this).val(jQuery(this).attr('title'));}" />
  </span>
  <div style="clear: both">
  </div>
</asp:Panel>

<script type="text/javascript">
  function onSearch() {
    var skey = document.getElementById('<%=txtSearchedKey.ClientID %>').value;
    if (skey == '') {
      alert('<%=String.Format(Resources.Messages.ERR0007, Resources.Strings.SearchKey) %>');
      return false;
    }
    return true;
  }
</script>

